


from analyse.kline_handler.enum import ShapeType
from analyse.trend_handler.kline_handler import TrendKlineHandler
from utils.kline import calc_actual_chg


class RiseKlineHandler(TrendKlineHandler):
   
   
   def analyse(self,props):
       parent=props["parent"]
       kline=props["kline"]
       klineType=props["klineType"]
       index=props["index"]
      
       

       if parent.trend['type']==klineType["rise_and_fall_type"]:
           if klineType["shape_type"]==ShapeType.一字.value:
               parent.trend["close"]=kline["close"]
               parent.trend["endIndex"]=index
               parent.trend["endTime"]=kline["time"]
               parent.trend["actualChg"]=calc_actual_chg(parent.trend["preClose"],kline["close"])